package cn.javase.base.io._03_转换流;

import java.io.*;

public class _转换流测试 {
    public static void main(String[] args) throws IOException {
        String path = Thread.currentThread().getContextClassLoader().getResource("about.txt").getPath();
        InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(path));
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream("relative.txt"));
        int data;
        while ((data = inputStreamReader.read()) != -1) {
            System.out.print((char)data);
            outputStreamWriter.write((char)data);
        }
        inputStreamReader.close();
        outputStreamWriter.flush();
        outputStreamWriter.close();
    }
}
